/**
 * 公共基础接口封装
 */
import request from '../utils/request'

// 获取商品分类Tree
export const getCategories = () => {
  return request({
    method: 'GET',
    url: '/categories'
  })
}

// 获取商品分类数据列表
export const getCategoriesList = (params) => {
  return request({
    method: 'GET',
    url: '/categories',
    params
  })
}

// 添加动态参数或者静态属性
export const addCategories = (data) => {
  return request({
    method: 'POST',
    url: '/categories',
    data
  })
}

// 编辑动态参数或者静态属性
export const editCategories = (cateId, data) => {
  return request({
    method: 'PUT',
    url: `/categories/${cateId}`,
    data
  })
}

// 删除动态参数或者静态属性
export const deleteCategories = (id) => {
  return request({
    method: 'DELETE',
    url: `/categories/${id}`
  })
}